package net.fei.scan.quick.ui

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import net.fei.scan.quick.R
import net.fei.scan.quick.adapter.HistoryAdapter
import net.fei.scan.quick.databinding.ActivityCreateBinding
import net.fei.scan.quick.entity.History

class CreateActivity : AppCompatActivity() {
    private lateinit var bin:ActivityCreateBinding
    private lateinit var list:ArrayList<History>
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        bin = ActivityCreateBinding.inflate(layoutInflater)
        setContentView(bin.root)

        addData()
    }

    private fun addData() {
        list= arrayListOf(
            History(R.drawable.a_paste,getString(R.string.dfksdjfdsfs)),
            History(R.drawable.a_url,"URL"),
            History(R.drawable.a_plaintext,getString(R.string.dfshvldsk)),
            History(R.drawable.a_user,getString(R.string.djfkshldkhdlsh)),
            History(R.drawable.a_email,getString(R.string.dfhldhv)),
            History(R.drawable.a_sms,getString(R.string.fdhsdhgdf)),
            History(R.drawable.a_location,getString(R.string.dkfjgvkldg)),
            History(R.drawable.af_phone,getString(R.string.dflkjhdlhgfd)),
            History(R.drawable.a_wifi,"Wifi"),
        )

        bin.rcv.apply {
            adapter=HistoryAdapter(this@CreateActivity,list)
            layoutManager= LinearLayoutManager(this@CreateActivity, LinearLayoutManager.VERTICAL, false)
        }
    }
}